<?php
/**
 * 适配器模式
 */
class Adaptee
{
    public function realRequest()
    {
        echo "适配器真正的调用方法";
    }
}

interface Target
{
    public function request();
}

class Adapter implements Target
{
    protected $adaptee;
    public function __construct(Adaptee $adaptee)
    {
        $this->adaptee = $adaptee;
    }
    
    public function request()
    {
        echo "适配器转化：";
        $this->adaptee->realRequest();
    }
}

$adaptee = new Adaptee();
$target = new Adapter($adaptee);
$target->request();